Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
hast-util-heading-rank
Advanced tools
hast utility to get the rank (or depth, level) of headings.
npm:
npm install hast-util-heading-rank
var h = require('hastscript')
var rank = require('hast-util-heading-rank')
rank(h('p', 'Alpha')) //=> null
rank(h('h5', 'Alpha')) //=> 5
headingRank(node)
Get the rank (1
to 6
) of headings (h1
to h6
).
node
(Node
) — Node to checkrank
(number?
) — Rank of the heading, or null
if not a heading.
hast-util-heading-rank
does not mutate.
There are no openings for cross-site scripting (XSS) attacks.
hast-util-heading
— check if a node is a heading elementhast-util-shift-heading
— utility to change heading rankSee contributing.md
in syntax-tree/.github
for ways to get
started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
hast utility to get the rank (or depth, level) of headings
The npm package hast-util-heading-rank receives a total of 2,267,841 weekly downloads. As such, hast-util-heading-rank popularity was classified as popular.
We found that hast-util-heading-rank demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.